package arrays;

import java.util.Arrays;

public class SimpleTest {

	public static void main(String[] args) {
		
		int[] array = new int[]{1, 2, 3, 4, 5};
		Arrays.fill(array, 7); //赋值
		System.out.println(Arrays.toString(array)); //打印
		
		Arrays.sort(array); //排序
		System.out.println(Arrays.toString(array)); 
		
		int[] array2 = array.clone(); //克隆一个数组
		System.out.println(Arrays.equals(array, array2)); //是否相等
		 
		System.out.println(Arrays.binarySearch(array, 7)); //二分查找
		
		int[] array3 = Arrays.copyOfRange(array, 0, 2); //复制部分元素
		System.out.println(Arrays.toString(array3));
	}
}
